﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using System.Diagnostics;

namespace YmtUserAuth.DataImport
{
    [TestFixture]
    public class DataImportTest
    {
        [Test]
        public void SyncReadFilet()
        {
            var watch = Stopwatch.StartNew();
            var readResult = ReadFile.SyncRead(@"E:\works\ymatou\project2\Ymatou\Main\YmatouAuth\data\ymt_user.csv");
            foreach (var item in readResult)
            {
                // Console.WriteLine(string.Format("{0},{1},{2}", item[0], item[1], item[2]));
            }
            var end = watch.ElapsedMilliseconds / 1000.0;
            Console.WriteLine("顺序读取总耗时 {0}", end);
        }

        [Test]
        public void AsyncReadFile()
        {

        }

        [Test]
        public void FillUserList()
        {
            var usrList = FillUserContainer.Fill(@"E:\works\ymatou\project2\Ymatou\Main\YmatouAuth\data\ymt_user2.csv");
            foreach (var item in usrList)
            {
                // Console.WriteLine(item.ToString());
            }
        }

        [Test]
        public void InsertMongodb()
        {
            DataImportAppService.Run();
        }

        [Test]
        public void InsertMongodb2()
        {
            DataImportAppService.Run2();
        }
    }
}
